package red.mlz.appconsumer.feign.game;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import red.mlz.common.entity.game.Game;

import java.util.List;

@FeignClient(name = "game-service", contextId = "game")
public interface GameFeign {

    @RequestMapping("/game-service/games")
    List<Game> getGames(@RequestParam(name = "page")Integer page,
                                         @RequestParam(name = "pageSize") Integer pageSize,
                                         @RequestParam(name = "keyword", required = false) String keyword);

    @RequestMapping("/game-service/game/{id}")
    Game getById(@PathVariable("id") Long id);
}
